package com.hp.easyBuy.controller;

import com.hp.easyBuy.entity.TNews;
import com.hp.easyBuy.service.NewService;
import com.hp.easyBuy.utils.R;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("news")
public class NewsController {


    @Resource
    private NewService newService;


    @RequestMapping("show")
    public R show(Integer id){
        TNews byId = newService.getById(id);
        return R.success(byId);
    }
}
